import 'package:boss/models/reback_order_list_data.dart';
import 'package:boss/ui/page/takeoutManagement/constant/takeout_status.dart';
import 'package:boss/ui/page/takeoutManagement/util/refund_util.dart';
import 'package:boss/ui/widget/button/radius_button.dart';
import 'package:flutter/material.dart';

class RebackButtonGroup extends StatelessWidget {
  final RebackOrderItem data;

  const RebackButtonGroup({Key key, this.data}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceAround,
      children: <Widget>[
        RadiusButton(
          title: '同意退款',
          onTap: () {
            RefundUtil.agree(
              context,
              refundId: data.refundId,
              status: TakeoutStatus.REBACK_ORDER,
              price: data.rebackAmount,
            );
          },
        ),
        RadiusButton(
          title: '拒绝退款',
          onTap: () {
            RefundUtil.reject(
              context,
              refundId: data.refundId,
              status: TakeoutStatus.REBACK_ORDER,
            );
          },
        ),
      ],
    );
  }
}
